/**
 * 下午1:55:42
 */
package com.itboye.base;

import android.content.Context;
import android.content.IntentFilter;
import android.net.ConnectivityManager;

/**
 * @author lizhenya
 *
 * @类描述：网络状态监听的管理器
 */
public class NetStateManager {
	private NetBroadcasttReceiver receiver;
	private Context mCtx;

	public void register(Context context) {
		this.mCtx = context;
		receiver = new NetBroadcasttReceiver();

		IntentFilter filter = new IntentFilter();
		filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
		context.registerReceiver(receiver, filter);
	}

	public void unregister() {
		mCtx.unregisterReceiver(receiver);
	}
}
